package observer.wechat;

/**
 * 
 * 订阅者（观察者）
 *
 */
public interface Subscriber {

	int receive(String publisher, String articleName);

}

class WechatClient implements Subscriber {

	private String username;

	public WechatClient(String username) {
		this.username = username;
	}

	@Override
	public int receive(String publisher, String articleName) {
		System.out.println(String.format("用户<%s>接收到<%s>发布的文章<%s>", this.username, publisher, articleName));
		return 0;
	}

}